<?php $this->load->view('header'); ?>
    <div id="search-project">
        <?php echo $this->load->view('sideBlocks/searchBlock') ?>
    </div>
    <div class="wrap-content wrap-public-message">
    </div>
    <div class="wrap-content wrap-project">
        <div class="container">
            <div class="">
                <div class="list-project col-lg-12">
                    <div class="table-projects row">
                        <table class="col-lg-12 table col-md-12 col-sm-12 col-xs-12 no-padding">
                            <thead>
                            <tr class="x8-16-b">
                                <td class="col-lg-4"><?php echo $this->lang->line("Project Name")?></td>
                                <td class="col-lg-2"><?php echo $this->lang->line("Num bid")?></td>
                                <td class="col-lg-2"><?php echo $this->lang->line("Skills")?></td>
                                <td class="col-lg-2"><?php echo $this->lang->line("Created")?></td>
                                <td class="col-lg-2"><?php echo $this->lang->line("budget")?></td>
                            </tr>
                            </thead>
                            <tbody>
                            <?php
                            if (isset($projects) and $projects->num_rows() > 0)
                            {
                                foreach ($projects->result() as $project)
                                {
                                    ?>
                                    <tr class="x8-15">
                                        <td class="xanh-16-b"><a href="<?php echo site_url('project/view/'.$project->id)?>"><?php echo $project->project_name; ?></a>
                                            <div class="rating-freelancer col-lg-12 no-padding">
                                                <input id="input-21e" value="0" type="number" data-star-captions="{}" data-default-caption="{rating}" class="rating" min=0 max=5 step=0.5 data-size="xs" >
                                            </div> <!-- rating-freelancer -->
                                        </td>
                                        <td><?php echo getNumBid($project->id)?></td>
                                        <td class="green-16"><?php echo getCategoryLinks($project->project_categories); ?></td>
                                        <td><?php
                                            if(date("d/m/y") == date("d/m/y",$project->created))
                                                echo "Hôm nay";
                                            else
                                                echo date("d/m/y", $project->created);?></td>
                                        <td class="green-20-b">$<?php echo $project->budget_max?></td>
                                    </tr>
                                    <tr>
                                        <td class="col-lg-9 col-sm-6 col-md-6 desc-list-project" colspan="3"><?php echo $project->description; ?></td>
                                        <td colspan="2" class="col-lg-3 col-sm-6 col-md-6">
                                            <div class="col-lg-12 col-sm-12 col-md-12 col-xs-12">
                                                <button type="button" onclick="window.location = '<?php echo site_url('project/create')?>'" class="btn btn-similar-project btn-lg btn-block">Đăng một dự án giống vậy</button>
                                            </div>
                                        </td>
                                    </tr>
                                <?php
                                }
                            }else{
                                echo "<tr>
                                    <td>".$this->lang->line('No Results')."</td>
                                </tr>";
                            }
                            ?>

                            </tbody>
                        </table>
                    </div> <!-- table-list-project -->
                    <div class="freelancer-pagination text-center col-lg-12 col-md-12 col-sm-12">
                        <?php if(isset($pagination)) echo $pagination;?>
                    </div> <!-- freelancer pagination -->
                </div> <!-- list-project -->
            </div> <!-- end row content -->
        </div>
    </div> <!-- wrap-content -->
<?php $this->load->view('footer'); ?>